<?php

namespace app\admin\model\classes;

use think\Model;


class Notice extends Model
{

    

    

    // 表名
    protected $name = 'classes_notice';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];

    public function getStatusList()
    {
        return ['0' => '隐藏', '1' => '显示'];
    }

    public function getResponseTypeList()
    {
        return [
                '0' => '无限制',
                '1' => '文字',
                '2' => '图片',
                '3' => '拍照',
                '4' => '录音',
                '5' => '视频',
                '6' => '文档',
            ];
    }
    public function getTypeList()
    {
        return [
            '0' => '需要家长查看',
            '1' => '需要家长确认',
            '2' => '需要家长回复',
        ];
    }

    public function classes()
    {
        return $this->belongsTo('Classes', 'classes_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function school()
    {
        return $this->belongsTo('School', 'admin_id', 'admin_id', [], 'LEFT')->setEagerlyType(0);
    }


    public function teacher()
    {
        return $this->belongsTo('Teacher', 'user_id', 'user_id', [], 'LEFT')->setEagerlyType(0);
    }
}
